package com.mida.dms.knw.mapper;

import com.mida.dms.knw.entity.KnwNoumenon;
import com.mida.dms.knw.entity.vo.KnwNoumenonPage;
import com.mida.dms.knw.entity.vo.KnwNoumenonTreeVo;
import com.mida.dms.knw.entity.vo.KnwNoumenonVo;
import com.mida.dms.knw.entity.vo.MapperPage;
import com.mida.dms.knw.vo.KnwNoumenonPageVo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface KnwNoumenonMapper{
    /**根据主键查询
     * @param soid 主键
     * @return
     */
    KnwNoumenon selectByPrimaryKey(Long soid) throws Exception;

    /**
     * 根据主键删除
     * @param soid 主键
     * @return
     */
    int deleteByPrimaryKey(Long soid) throws Exception;

    /**
     * 新增
     * @param record
     * @return
     */
    int insert(KnwNoumenon record) throws Exception;

    /**
     * 分页总数
     * @param page
     * @return
     */
    int findPageCount(KnwNoumenonPage page) throws Exception;

    /**
     * 分页
     * @param page
     * @return
     */
    List<KnwNoumenonVo> findPage(KnwNoumenonPage page) throws Exception;

    /**
     * 查找本体相关信息(包括规则信息等)
     * @param soid
     * @return
     * @throws Exception
     */
    KnwNoumenonVo findSingle(Long soid) throws Exception;

    /**
     * 根据主键更新
     * @param record
     * @return
     */
    int updateByPrimaryKey(KnwNoumenon record) throws Exception;

    /**
     * 根据主键更新,只更新入参不为空的参数对应的值
     * @param record
     * @return
     */
    int updateByPrimaryKeySelective(KnwNoumenon record) throws Exception;

    /**
     * 查询本体名数量
     * @param knwNoumenon
     * @return
     */
    int countName(KnwNoumenon knwNoumenon);

    /**
     * 删除前检查本体是否有实例
     * @param noumenonSoid
     * @return
     */
    int countIndividual(Long noumenonSoid);

    boolean updateStatusByNoumenonSoid(@Param("noumenonSoid") Long noumenonSoid, @Param("date") Date updateTime);

    /**
     * 判断返回的本体是不是草稿状态
     * @param noumenonSoid
     * @return
     */
    int countDraft(Long noumenonSoid);

    /**
     * 判断返回的本体是不是启用状态
     * @param noumenonSoid
     * @return
     */
    int countUse(Long noumenonSoid);

    List<KnwNoumenonVo> selectNoumenons(@Param("idList") List<Long> idList);

    List<Long> getNoumenonIdList(MapperPage page);

    List<KnwNoumenon> selectNoumenonNameByCSoid(Long conceptualSoid);

    List<KnwNoumenonVo> findAll(@Param("search") String search);

    List<KnwNoumenon> selectByConceptualSoid(long conceptualSoid);

    int deleteSlot(long noumenonSoid);

    List<KnwNoumenonTreeVo> getTree();

    Integer countDefineSpace(Long defineSpaceSoid);

    List<KnwNoumenon> selectNoumenonShowNameByType(@Param("type") Long type, @Param("subType") Long subType);

    List<KnwNoumenonVo> getKnwNoumenonVoList(KnwNoumenonPage page) throws Exception;

    KnwNoumenonVo getKnwNoumenon(Long conceptualSoid) throws Exception;

    List<KnwNoumenonVo> getKnwNoumenonList(Map<String, Object> map) throws Exception;

    List<KnwNoumenonVo> getKnwNoumenons(List<Long> conceptualSoids) throws Exception;

    List<KnwNoumenonVo> selectKnwNoumenonVos(KnwNoumenonPage npage);

    List<KnwNoumenonVo> selectKnwNoumenonVoList(Map<String, Object> map);

    int findPageCounts(KnwNoumenonPage npage);

    int findCansolePageCounts(KnwNoumenonPage npage);

    List<KnwNoumenonVo> selectCansoleKnwNoumenonVos(KnwNoumenonPage npage);
}